# coding=utf-8
from enum import Enum

tdx_hosts = [
    ("通达信深圳双线主站1", "110.41.147.114", 7709),
    ("通达信深圳双线主站2", "110.41.2.72", 7709),
    ("通达信深圳双线主站3", "110.41.4.4", 7709),
    ("通达信深圳双线主站4", "47.113.94.204", 7709),
    ("通达信深圳双线主站5", "8.129.174.169", 7709),
    ("通达信深圳双线主站6", "110.41.154.219", 7709),
    ("通达信上海双线主站1", "124.70.176.52", 7709),
    ("通达信上海双线主站2", "47.100.236.28", 7709),
    ("通达信上海双线主站3", "123.60.186.45", 7709),
    ("通达信上海双线主站4", "123.60.164.122", 7709),
    ("通达信上海双线主站5", "47.116.105.28", 7709),
    ("通达信上海双线主站6", "124.70.199.56", 7709),
    ("通达信北京双线主站1", "121.36.54.217", 7709),
    ("通达信北京双线主站2", "121.36.81.195", 7709),
    ("通达信北京双线主站3", "123.249.15.60", 7709),
    ("通达信广州双线主站1", "124.71.85.110", 7709),
    ("通达信广州双线主站2", "139.9.51.18", 7709),
    ("通达信广州双线主站3", "139.159.239.163", 7709),
    ("通达信上海双线主站7", "106.14.201.131", 7709),
    ("通达信上海双线主站8", "106.14.190.242", 7709),
    ("通达信上海双线主站9", "121.36.225.169", 7709),
    ("通达信上海双线主站10", "123.60.70.228", 7709),
    ("通达信上海双线主站11", "123.60.73.44", 7709),
    ("通达信上海双线主站12", "124.70.133.119", 7709),
    ("通达信上海双线主站13", "124.71.187.72", 7709),
    ("通达信上海双线主站14", "124.71.187.122", 7709),
    ("通达信武汉电信主站1", "119.97.185.59", 7709),
    ("通达信深圳双线主站7", "47.107.64.168", 7709),
    ("通达信北京双线主站4", "124.70.75.113", 7709),
    ("通达信广州双线主站4", "124.71.9.153", 7709),
    ("通达信上海双线主站15", "123.60.84.66", 7709),
    ("通达信深圳双线主站8", "47.107.228.47", 7719),
    ("通达信北京双线主站5", "120.46.186.223", 7709),
    ("通达信北京双线主站6", "124.70.22.210", 7709),
    ("通达信北京双线主站7", "139.9.133.247", 7709),
    ("通达信广州双线主站5", "116.205.163.254", 7709),
    ("通达信广州双线主站6", "116.205.171.132", 7709),
    ("通达信广州双线主站7", "116.205.183.150", 7709),
]

broker_hosts = [
    # ("长城国瑞电信1", "218.85.139.19", 7709),
    # ("长城国瑞电信2", "218.85.139.20", 7709),
    # ("长城国瑞网通", "58.23.131.163", 7709),
    ("上证云成都电信一", "218.6.170.47", 7709),
    ("上证云北京联通一", "123.125.108.14", 7709),
    ("上海电信主站Z1", "180.153.18.170", 7709),
    # ("上海电信主站Z2", "180.153.18.171", 7709),
    ("上海电信主站Z80", "180.153.18.172", 80),
    # ("北京联通主站Z1", "202.108.253.130", 7709),
    # ("北京联通主站Z2", "202.108.253.131", 7709),
    ("北京联通主站Z80", "202.108.253.139", 80),
    ("杭州电信主站J1", "60.191.117.167", 7709),
    ("杭州电信主站J2", "115.238.56.198", 7709),
    ("杭州电信主站J3", "218.75.126.9", 7709),
    ("杭州电信主站J4", "115.238.90.165", 7709),
    # ("杭州联通主站J1", "124.160.88.183", 7709),
    # ("杭州联通主站J2", "60.12.136.250", 7709),
    # ("杭州华数主站J1", "218.108.98.244", 7709),
    # ("杭州华数主站J2", "218.108.47.69", 7709),
    # ("义乌移动主站J1", "223.94.89.115", 7709),
    # ("青岛联通主站W1", "218.57.11.101", 7709),
    # ("青岛电信主站W1", "58.58.33.123", 7709),
    # ("深圳电信主站Z1", "14.17.75.71", 7709),
    # ("云行情上海电信Z1", "114.80.63.12", 7709),
    # ("云行情上海电信Z2", "114.80.63.35", 7709),
    # ("上海电信主站Z3", "180.153.39.51", 7709),
    # ('招商证券深圳行情', '119.147.212.81', 7709),
    # ('华泰证券(南京电信)', '221.231.141.60', 7709),
    # ('华泰证券(上海电信)', '101.227.73.20', 7709),
    # ('华泰证券(上海电信二)', '101.227.77.254', 7709),
    # ('华泰证券(深圳电信)', '14.215.128.18', 7709),
    # ('华泰证券(武汉电信)', '59.173.18.140', 7709),
    # ('华泰证券(天津联通)', '60.28.23.80', 7709),
    # ('华泰证券(沈阳联通)', '218.60.29.136', 7709),
    # ('华泰证券(南京联通)', '122.192.35.44', 7709),
    # ('华泰证券(南京联通)', '122.192.35.44', 7709),
    # ('安信', '112.95.140.74', 7709),
    # ('安信', '112.95.140.92', 7709),
    # ('安信', '112.95.140.93', 7709),
    # ('安信', '114.80.149.19', 7709),
    # ('安信', '114.80.149.21', 7709),
    # ('安信', '114.80.149.22', 7709),
    # ('安信', '114.80.149.91', 7709),
    # ('安信', '114.80.149.92', 7709),
    # ('安信', '121.14.104.60', 7709),
    # ('安信', '121.14.104.66', 7709),
    # ('安信', '123.126.133.13', 7709),
    # ('安信', '123.126.133.14', 7709),
    # ('安信', '123.126.133.21', 7709),
    # ('安信', '211.139.150.61', 7709),
    ('安信', '59.36.5.11', 7709),
    ('广发', '119.29.19.242', 7709),
    # ('广发', '123.138.29.107', 7709),
    # ('广发', '123.138.29.108', 7709),
    # ('广发', '124.232.142.29', 7709),
    # ('广发', '183.57.72.11', 7709),
    # ('广发', '183.57.72.12', 7709),
    # ('广发', '183.57.72.13', 7709),
    # ('广发', '183.57.72.15', 7709),
    # ('广发', '183.57.72.21', 7709),
    # ('广发', '183.57.72.22', 7709),
    # ('广发', '183.57.72.23', 7709),
    # ('广发', '183.57.72.24', 7709),
    ('广发', '183.60.224.177', 7709),
    ('广发', '183.60.224.178', 7709),
    # ('国泰君安', '113.105.92.100', 7709),
    # ('国泰君安', '113.105.92.101', 7709),
    # ('国泰君安', '113.105.92.102', 7709),
    # ('国泰君安', '113.105.92.103', 7709),
    # ('国泰君安', '113.105.92.104', 7709),
    # ('国泰君安', '113.105.92.99', 7709),
    ('国泰君安', '117.34.114.13', 7709),
    ('国泰君安', '117.34.114.14', 7709),
    ('国泰君安', '117.34.114.15', 7709),
    ('国泰君安', '117.34.114.16', 7709),
    ('国泰君安', '117.34.114.17', 7709),
    ('国泰君安', '117.34.114.18', 7709),
    ('国泰君安', '117.34.114.20', 7709),
    ('国泰君安', '117.34.114.27', 7709),
    ('国泰君安', '117.34.114.30', 7709),
    ('国泰君安', '117.34.114.31', 7709),
    ('国信', '182.131.3.252', 7709),
    # ('国信', '183.60.224.11', 7709),
    # ('国信', '58.210.106.91', 7709),
    # ('国信', '58.63.254.216', 7709),
    # ('国信', '58.63.254.219', 7709),
    ('国信', '58.63.254.247', 7709),
    ('海通', '123.125.108.90', 7709),
    ('海通', '175.6.5.153', 7709),
    ('海通', '182.118.47.151', 7709),
    ('海通', '182.131.3.245', 7709),
    ('海通', '202.100.166.27', 7709),
    # ('海通', '222.161.249.156', 7709),
    # ('海通', '42.123.69.62', 7709),
    ('海通', '58.63.254.191', 7709),
    ('海通', '58.63.254.217', 7709),
    # ('华林', '120.55.172.97', 7709),
    # ('华林', '139.217.20.27', 7709),
    ('华林', '202.100.166.21', 7709),
    ('华林', '202.96.138.90', 7709),
    # ('华林', '218.106.92.182', 7709),
    # ('华林', '218.106.92.183', 7709),
    # ('华林', '220.178.55.71', 7709),
    # ('华林', '220.178.55.86', 7709),
]

class MARKET(Enum):
    # 0 - 深圳， 1 - 上海
    SZ = 0
    SH = 1
    BJ = 2

class CATEGORY(Enum):
    SH = 0      # 上证A
    SZ = 2      # 深证A
    A = 6       # A股
    B = 7       # B股
    KCB = 8     # 科创板
    BJ = 12     # 北证A
    CYB = 14    # 创业板

class KLINE_TYPE(Enum):
    # 0 -   5 分钟K 线
    # 1 -   15 分钟K 线
    # 2 -   30 分钟K 线
    # 3 -   1 小时K 线
    # 4 -   日K 线
    # 5 -   周K 线
    # 6 -   月K 线
    # 7 -   1 分钟
    # 8 -   1 分钟K 线
    # 9 -   日K 线
    # 10 -  季K 线
    # 11 -  年K 线
    FIVE_MIN = 0
    FIFTEEN_MIN = 1
    THIRTY_MIN = 2
    ONE_HOUR = 3
    DAILY = 4
    WEEKLY = 5
    MONTHLY = 6
    EXHQ_1_MIN = 7
    ONE_MIN = 8
    DAY_K = 9
    THREE_MONTH = 10
    YEARLY = 11

class BLOCK_FILE_TYPE(Enum):
    DEFAULT = 'block.dat'   # 一般板块
    ZS = 'block_zs.dat'     # 指数板块
    FG = 'block_fg.dat'     # 风格板块
    GN = 'block_gn.dat'     # 概念板块
    TDXHY = 'tdxhy.cfg'     # 通信达行业和申万行业对照表
